// 俩个方法 createRouter：创建router实例的   createWebHashHistory:创建一个hash模式的路由
import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import PlayGround from '@/views/Playground'
const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/',
        component: Home
      }
    ]
  },
  {
    path: '/play',
    component: PlayGround
  }
]

// router就是一个路由实例对象
const router = createRouter({
  // 当前路由模式是hash模式
  history: createWebHashHistory(),
  routes
})

export default router
